package cn.stu.cms.util;

import cn.hutool.core.util.ReflectUtil;
import org.springframework.cglib.beans.BeanCopier;

/**
 * @author gh
 * @date 2023/09/22
 */
public class BeanUtils {
    public static <T> T copier(Object source, Class<T> tClass, String... ignoreProperties) {
        T target = ReflectUtil.newInstanceIfPossible(tClass);
        BeanCopier copier = BeanCopier.create(source.getClass(), tClass, false);
        copier.copy(source, target, null);
        return target;
    }
}